﻿<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="en" class="app">
<head>
	<meta charset="utf-8" />
	<title>紅花（香港）集團-众艾车代理商管理系统</title>
	<meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
	<%@ include file="/core/memberZong.jsp" %>

	<script type="text/javascript">
        var checkSubmitFlg = false;
        function checkSubmit() {

            if ($('#content').val() == '') {
                alert('请输入内容。');

                return false;
            }
            if ($('#password').val() == '') {
                alert('请输入安全密码。');

                return false;
            }

            var allowType = [ 'jpeg', 'pic', 'bmp', 'jpg', 'gif', 'png' ];
            var fileExt = getFileExt(fileVal);
            if (!allowType.contains(fileExt)) {
                alert('上传的文件不是正确的图片格式!');

                return false;
            }
            if (checkSubmitFlg == true) {
                return false;
            }
            checkSubmitFlg = true;
            return true;
        }
        document.ondblclick = function docondblclick() {
            window.event.returnValue = false;
        }
        document.onclick = function doconclick() {
            if (checkSubmitFlg) {
                window.event.returnValue = false;
            }
        }
	</script>
<style>
	.form-group img{max-width: 100%}
</style>
</head>
<body>
<section class="vbox">
	<section>
		<section class="hbox stretch">
			<section id="content1">
				<section class="vbox">
					<section class="scrollable padder">

						<div class="m-b-md">
							<h3 class="m-b-none">留言详情</h3>
						</div>
						<section class="panel panel-default">


							<header class="panel-heading font-bold"> 留言内容 </header>
							<div class="panel-body">
								<form class="form-horizontal" >
										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">标题：</label>
											<div class="col-sm-10">
												${message.title}
											</div>
										</div>

									<div class="line line-dashed line-lg pull-in"></div>
									<div class="form-group">
										<label class="col-sm-2 control-label">内容：</label>
										<div class="col-sm-10">
											<c:if test="${message.filePath!=null}">
												<br />
												<a href="<%=basePath%>temp/${message.fileName}" target="_blank"> <img src='<%=basePath%>/temp/${message.fileName}'  />
												</a>
											</c:if>
											</br>
											${message.content}
											</br>
										</div>
									</div>

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">时间：</label>
											<div class="col-sm-10">
												<fmt:formatDate value="${message.operDate}" type="date" pattern="yyyy-MM-dd HH:mm" />
											</div>
										</div>

								</form>
							</div>

							<c:forEach items="${list}" var="o">

								<header class="panel-heading font-bold"> 留言回复 </header>
								<div class="panel-body">
									<form class="form-horizontal" >

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">内容：</label>
											<div class="col-sm-10">
												<c:if test="${o.filePath!=null}">
													<br />
													<a href="<%=basePath%>temp/${o.fileName}" target="_blank"> <img src='<%=basePath%>/temp/${o.fileName}'  />
													</a>
												</c:if>
												</br>
													${o.content}
												</br>
											</div>
										</div>

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">时间：</label>
											<div class="col-sm-10">
												<fmt:formatDate value="${o.operDate}" type="date" pattern="yyyy-MM-dd HH:mm" />
											</div>
										</div>

									</form>
								</div>

							</c:forEach>

							<header class="panel-heading font-bold"> 留言回复 </header>
							<div class="panel-body">
								<form class="form-horizontal" action="<%=basePath%>/member/info/messageShowAdd.shtml" enctype="multipart/form-data" method="post" onsubmit="return checkSubmit();">
									<jodd:form scopes="request" beans="message">
									<input type="hidden" id="id" name="id" />
									<div class="line line-dashed line-lg pull-in"></div>
									<div class="form-group">
										<label class="col-sm-2 control-label">内容：</label>
										<div class="col-sm-10">
											<textarea type="text" id="content" name="content" class="form-control" placeholder="内容"  style="height:100px; "></textarea>
										</div>
									</div>

									<div class="line line-dashed line-lg pull-in"></div>
									<div class="form-group">
										<label class="col-sm-2 control-label">图片地址：</label>
										<div class="col-sm-10">
											<input type="file" id="file" name="file" class="form-control" placeholder="图片地址">
										</div>
									</div>

									<div class="line line-dashed line-lg pull-in"></div>
									<div class="form-group">
										<label class="col-sm-2 control-label">安全密码:</label>
										<div class="col-sm-10">
											<input type="password" id="myTwoPassword" name="myTwoPassword" class="form-control" placeholder="安全密码">
										</div>
									</div>

									<div class="line line-dashed line-lg pull-in"></div>
									<div class="form-group">
										<div class="col-sm-4 col-sm-offset-2">
											${retMsg}
										</div>
									</div>

									<div class="line line-dashed line-lg pull-in"></div>
									<div class="form-group">
										<div class="col-sm-4 col-sm-offset-2">
											<%--<button type="submit" class="btn btn-default">Cancel</button>--%>
											<button type="submit" id="submit" name="submit" class="btn btn-primary">提交</button>
										</div>
									</div>
									</jodd:form>
								</form>

							</div>
						</section>
					</section>
				</section>

			</section>
		</section>
	</section>

</section>
</body>
</html>